<?php

class StoreControl extends Control {

	public function buystuff()
	{
        $uid = self::isauth();
        if (!$uid) return $this->out_error(ERR303);

		$serialid = $_POST["serialid"];
		$cnt = intval($_POST["cnt"]);

        $ret = modcall("store", "buystuff", array($uid, $serialid, $cnt));
        if ($ret['ecode']) return $this->out_error($ret['ecode']);
        else return $this->out_result(&$ret['ret']);
    }

	public function buyequip()
	{
        $uid = self::isauth();
        if (!$uid) return $this->out_error(ERR303);

		$serialid = $_POST["serialid"];

        $ret = modcall("store", "buyequip", array($uid, $serialid));
        if ($ret['ecode']) return $this->out_error($ret['ecode']);
        else return $this->out_result(&$ret['ret']);
    }

}